3.814 \(\int \frac{a+b x+c x^2}{(d+e x) (f+g x)} \, dx\)

Optimal. Leaf size=83 \[ \frac{\log (d+e x) \left (a e^2-b d e+c d^2\right )}{e^2 (e f-d g)}-\frac{\log (f+g x) \left (a g^2-b f g+c f^2\right )}{g^2 (e f-d g)}+\frac{c x}{e g} \]

[Out]

(c*x)/(e*g) + ((c*d^2 - b*d*e + a*e^2)*Log[d + e*x])/(e^2*(e*f - d*g)) - ((c*f^2
 - b*f*g + a*g^2)*Log[f + g*x])/(g^2*(e*f - d*g))

_______________________________________________________________________________________

Rubi [A]  time = 0.204558, antiderivative size = 83, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 1, integrand size = 25, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.04 \[ \frac{\log (d+e x) \left (a e^2-b d e+c d^2\right )}{e^2 (e f-d g)}-\frac{\log (f+g x) \left (a g^2-b f g+c f^2\right )}{g^2 (e f-d g)}+\frac{c x}{e g} \]

Antiderivative was successfully verified.

[In]  Int[(a + b*x + c*x^2)/((d + e*x)*(f + g*x)),x]

[Out]

(c*x)/(e*g) + ((c*d^2 - b*d*e + a*e^2)*Log[d + e*x])/(e^2*(e*f - d*g)) - ((c*f^2
 - b*f*g + a*g^2)*Log[f + g*x])/(g^2*(e*f - d*g))

_______________________________________________________________________________________

Rubi in Sympy [F]  time = 0., size = 0, normalized size = 0. \[ \frac{\left (a g^{2} - b f g + c f^{2}\right ) \log{\left (f + g x \right )}}{g^{2} \left (d g - e f\right )} + \frac{\int c\, dx}{e g} - \frac{\left (a e^{2} - b d e + c d^{2}\right ) \log{\left (d + e x \right )}}{e^{2} \left (d g - e f\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  rubi_integrate((c*x**2+b*x+a)/(e*x+d)/(g*x+f),x)

[Out]

(a*g**2 - b*f*g + c*f**2)*log(f + g*x)/(g**2*(d*g - e*f)) + Integral(c, x)/(e*g)
 - (a*e**2 - b*d*e + c*d**2)*log(d + e*x)/(e**2*(d*g - e*f))

_______________________________________________________________________________________

Mathematica [A]  time = 0.0956298, size = 85, normalized size = 1.02 \[ -\frac{\log (d+e x) \left (-a e^2+b d e-c d^2\right )}{e^2 (e f-d g)}-\frac{\log (f+g x) \left (a g^2-b f g+c f^2\right )}{g^2 (e f-d g)}+\frac{c x}{e g} \]

Antiderivative was successfully verified.

[In]  Integrate[(a + b*x + c*x^2)/((d + e*x)*(f + g*x)),x]

[Out]

(c*x)/(e*g) - ((-(c*d^2) + b*d*e - a*e^2)*Log[d + e*x])/(e^2*(e*f - d*g)) - ((c*
f^2 - b*f*g + a*g^2)*Log[f + g*x])/(g^2*(e*f - d*g))

_______________________________________________________________________________________

Maple [A]  time = 0.011, size = 142, normalized size = 1.7 \[{\frac{cx}{eg}}+{\frac{\ln \left ( gx+f \right ) a}{dg-ef}}-{\frac{\ln \left ( gx+f \right ) bf}{ \left ( dg-ef \right ) g}}+{\frac{\ln \left ( gx+f \right ) c{f}^{2}}{{g}^{2} \left ( dg-ef \right ) }}-{\frac{\ln \left ( ex+d \right ) a}{dg-ef}}+{\frac{\ln \left ( ex+d \right ) bd}{ \left ( dg-ef \right ) e}}-{\frac{\ln \left ( ex+d \right ) c{d}^{2}}{ \left ( dg-ef \right ){e}^{2}}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  int((c*x^2+b*x+a)/(e*x+d)/(g*x+f),x)

[Out]

c*x/e/g+1/(d*g-e*f)*ln(g*x+f)*a-1/g/(d*g-e*f)*ln(g*x+f)*b*f+1/g^2/(d*g-e*f)*ln(g
*x+f)*c*f^2-1/(d*g-e*f)*ln(e*x+d)*a+1/(d*g-e*f)/e*ln(e*x+d)*b*d-1/(d*g-e*f)/e^2*
ln(e*x+d)*c*d^2

_______________________________________________________________________________________

Maxima [A]  time = 0.692818, size = 117, normalized size = 1.41 \[ \frac{{\left (c d^{2} - b d e + a e^{2}\right )} \log \left (e x + d\right )}{e^{3} f - d e^{2} g} - \frac{{\left (c f^{2} - b f g + a g^{2}\right )} \log \left (g x + f\right )}{e f g^{2} - d g^{3}} + \frac{c x}{e g} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((c*x^2 + b*x + a)/((e*x + d)*(g*x + f)),x, algorithm="maxima")

[Out]

(c*d^2 - b*d*e + a*e^2)*log(e*x + d)/(e^3*f - d*e^2*g) - (c*f^2 - b*f*g + a*g^2)
*log(g*x + f)/(e*f*g^2 - d*g^3) + c*x/(e*g)

_______________________________________________________________________________________

Fricas [A]  time = 0.295032, size = 134, normalized size = 1.61 \[ \frac{{\left (c d^{2} - b d e + a e^{2}\right )} g^{2} \log \left (e x + d\right ) +{\left (c e^{2} f g - c d e g^{2}\right )} x -{\left (c e^{2} f^{2} - b e^{2} f g + a e^{2} g^{2}\right )} \log \left (g x + f\right )}{e^{3} f g^{2} - d e^{2} g^{3}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((c*x^2 + b*x + a)/((e*x + d)*(g*x + f)),x, algorithm="fricas")

[Out]

((c*d^2 - b*d*e + a*e^2)*g^2*log(e*x + d) + (c*e^2*f*g - c*d*e*g^2)*x - (c*e^2*f
^2 - b*e^2*f*g + a*e^2*g^2)*log(g*x + f))/(e^3*f*g^2 - d*e^2*g^3)

_______________________________________________________________________________________

Sympy [A]  time = 15.4255, size = 420, normalized size = 5.06 \[ \frac{c x}{e g} + \frac{\left (a g^{2} - b f g + c f^{2}\right ) \log{\left (x + \frac{a d e g^{2} + a e^{2} f g - 2 b d e f g + c d^{2} f g + c d e f^{2} - \frac{d^{2} e g \left (a g^{2} - b f g + c f^{2}\right )}{d g - e f} + \frac{2 d e^{2} f \left (a g^{2} - b f g + c f^{2}\right )}{d g - e f} - \frac{e^{3} f^{2} \left (a g^{2} - b f g + c f^{2}\right )}{g \left (d g - e f\right )}}{2 a e^{2} g^{2} - b d e g^{2} - b e^{2} f g + c d^{2} g^{2} + c e^{2} f^{2}} \right )}}{g^{2} \left (d g - e f\right )} - \frac{\left (a e^{2} - b d e + c d^{2}\right ) \log{\left (x + \frac{a d e g^{2} + a e^{2} f g - 2 b d e f g + c d^{2} f g + c d e f^{2} + \frac{d^{2} g^{3} \left (a e^{2} - b d e + c d^{2}\right )}{e \left (d g - e f\right )} - \frac{2 d f g^{2} \left (a e^{2} - b d e + c d^{2}\right )}{d g - e f} + \frac{e f^{2} g \left (a e^{2} - b d e + c d^{2}\right )}{d g - e f}}{2 a e^{2} g^{2} - b d e g^{2} - b e^{2} f g + c d^{2} g^{2} + c e^{2} f^{2}} \right )}}{e^{2} \left (d g - e f\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((c*x**2+b*x+a)/(e*x+d)/(g*x+f),x)

[Out]

c*x/(e*g) + (a*g**2 - b*f*g + c*f**2)*log(x + (a*d*e*g**2 + a*e**2*f*g - 2*b*d*e
*f*g + c*d**2*f*g + c*d*e*f**2 - d**2*e*g*(a*g**2 - b*f*g + c*f**2)/(d*g - e*f)
+ 2*d*e**2*f*(a*g**2 - b*f*g + c*f**2)/(d*g - e*f) - e**3*f**2*(a*g**2 - b*f*g +
 c*f**2)/(g*(d*g - e*f)))/(2*a*e**2*g**2 - b*d*e*g**2 - b*e**2*f*g + c*d**2*g**2
 + c*e**2*f**2))/(g**2*(d*g - e*f)) - (a*e**2 - b*d*e + c*d**2)*log(x + (a*d*e*g
**2 + a*e**2*f*g - 2*b*d*e*f*g + c*d**2*f*g + c*d*e*f**2 + d**2*g**3*(a*e**2 - b
*d*e + c*d**2)/(e*(d*g - e*f)) - 2*d*f*g**2*(a*e**2 - b*d*e + c*d**2)/(d*g - e*f
) + e*f**2*g*(a*e**2 - b*d*e + c*d**2)/(d*g - e*f))/(2*a*e**2*g**2 - b*d*e*g**2
- b*e**2*f*g + c*d**2*g**2 + c*e**2*f**2))/(e**2*(d*g - e*f))

_______________________________________________________________________________________

GIAC/XCAS [F(-2)]  time = 0., size = 0, normalized size = 0. \[ \text{Exception raised: NotImplementedError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((c*x^2 + b*x + a)/((e*x + d)*(g*x + f)),x, algorithm="giac")

[Out]

Exception raised: NotImplementedError